<!DOCTYPE HTML>
<html>
<head>
    <title>户籍迁入审核</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
</head>
<body>
<div class="mini-fit">
    <div style="height:100%;width: 100%;overflow-x: auto;overflow-y: auto;">
        <form id="form1" method="post" style="margin-left: 50px;">
            <div id="editform1" class="form">
                <#--罪犯编号-->
                <input id="priNum" name="priNum" class="mini-hidden" value="${priNum!''}" />
                <#--id-->
                <input id="id" name="id" class="mini-hidden" value="${id!''}" />
                <table class="form-table" width="100%">
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">姓&emsp;&emsp;名:</td>
                        <td style="width: 80%">
                            ${pname!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">性&emsp;&emsp;别:</td>
                        <td style="width: 80%">
                            ${sex!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">身份证号:</td>
                        <td style="width: 80%">
                            ${idnum!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">出生日期:</td>
                        <td style="width: 80%">
                            ${age!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">事&emsp;&emsp;由:</td>
                        <td style="width: 80%">
                            ${remark!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">申请时间:</td>
                        <td style="width: 80%">
                            ${outapplytime!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right">户籍转入:</td>
                        <td style="width: 80%">
                            ${hjzr!''}
                        </td>
                    </tr>
                    <tr>
                        <td style="width:  20%;line-height: 25px;" align="right"><font color="#dc143c">*</font>审核意见:</td>
                        <td style="width: 80%">
                            <input id="state" name="state" class="mini-combobox" style="width: 200px" onvaluechanged="yjChanged()"
                                   data="[{ id:2,name: '通过'},{ id:3,name:'不通过'}]"
                                   textField="name" valueField="id" required="true" />
                        </td>
                    </tr>
                </table>
            </div>
            <div id="editform3" class="form" style="display: none">
                <table class="form-table" width="100%">
                    <tr>
                        <td style="width:20%;line-height: 25px;" align="right"><font color="#dc143c">*</font>不同意原因:</td>
                        <td style="width:80%">
                            <input id="thsy" name="thsy" class="mini-textarea" width="50%" height="100px" value="${thsy!''}" required="true" />
                        </td>
                    </tr>
                </table>
            </div>
            <!-- 用户 编辑框START-->
            <div id="fileform" class="form1" style="width: 100%;">
                <table class="form-table" width="100%" style="padding-left: 6%;">
                    <tr>
                        <td width="15%" align="right" style="line-height: 40px;">
                            附件下载:
                        </td>
                        <td >
                            <input type="button" value="查看附件" onclick="onFileUpload()"><span  style="color: #8B8B8B" ></span>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</div>
<div style="padding:20px;text-align: center">
    <a class="mini-button" iconCls="fa-save" plain="true" onclick="saveData()">保存</a>
    <a class="mini-button" iconCls="fa-undo" plain="true" onclick="close('cancel')">取消</a>
</div>

<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");
    var stateObj = mini.get("state");
    var thsyObj = mini.get("thsy");
    var priNum = mini.get("priNum");
    var id = mini.get("id");

    function saveData() {
        form.validate();
        if (form.isValid() == false) {
            return;
        }
        var data = form.getData();
        var json = mini.encode(data);

        // 添加迁出审核通过/不通过二次确认框
        mini.confirm("确定要完成迁出审核?","确定?",function (action){
            if (action == "ok"){
                $.ajax({
                    url: "/azbj/bjdxInfo/hjqc/shenheSave",
                    type: "post",
                    data: {data: json},
                    success: function (success) {
                        if (success.code == 1) {
                            mini.alert("保存成功", "成功", window.CloseOwnerWindow);
                        }else if (success.code == 5599) {
                            mini.alert(success.message);
                        }
                    }
                });
            }else{
                return;
            }
        })
    }

    function yjChanged() {
        var state = stateObj.getValue();
        if (state == 3) {
            document.getElementById("editform3").style.display = "block";
            thsyObj.doLayout();
        } else {
            document.getElementById("editform3").style.display = "none";
        }
    }

    function close(action) {
        if (window.CloseOwnerWindow) {
            window.CloseOwnerWindow(action);
        } else {
            window.close();
        }
    }

    <!-- 上传附件 -->
    function onFileUpload(e) {
        var idval = id.getValue();
        var pidval = priNum.getValue();
        // 户籍迁移附件task= 13
        var taskid = "13";
        commonEdit("/upload/user/uploadAppendixfile/see?1=1&id="+idval+"&priNum="+pidval+"&taskId=" + taskid, null, null, 600, 400, true, true, true);
    }
</script>
</body>
</html>